package cn.sytton.taffe.monitor.controller;

import cn.sytton.taffe.monitor.model.Server;
import cn.sytton.taffe.monitor.service.ServerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 服务器监控控制层
 *
 * @author skyrock
 */
@Tag(name = "服务器监控")
@RestController
@RequestMapping("/monitor/server")
public class ServerController {

    @Resource
    private ServerService serverService;

    @Operation(summary = "获取服务器信息")
    @GetMapping
    public Server findInfo() {
        return serverService.copyTo();
    }
}
